Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Ink Properties

For QuickTime vectors, there is one accessible property in an ink object. Transfer mode is the way, or mode, of transferring the color to its destination (the screen or printed page or other location into which the shape associated with this ink is drawn). Transfer mode is a specification (such as "copy" or "XOR" or "blend") of the interaction between the color in this ink object and the existing color or colors of the destination. With transfer mode you can make a shape opaque or transparent, draw only part of it, change its color, or combine its color with the destination color in many different ways. The transfer mode also includes a specification of a color space.

Color

One main purpose of an ink object's existence is to specify the color of a shape. Because there is only one ink object per shape, it follows that each QuickDraw GX shape can have only one color. The only exception to this is for bitmap shapes, which use pixel values rather than an ink object to specify colors. (Picture shapes have no color at all apart from the colors of their component shapes, and thus do not use their ink object.)

The color in an ink object is defined with a gxColor structure:

struct gxColor{
    gxColorSpace                space;
    gxColorProfile              profile;
    union {
            struct gxCMYKColor              cmyk;
            struct gxRGBColor               rgb;
            struct gxRGBAColor              rgba;
            struct gxHSVColor               hsv;
            struct gxHLSColor               hls;
            struct gxXYZColor               xyz;
            struct gxYXYColor               yxy;
            struct gxLUVColor               luv;
            struct gxLABColor               lab;
            struct gxYIQColor               yiq;
            gxColorValue                    gray;
            struct gxGrayAColor             graya;
            unsigned short                  pixel16;
            unsigned long                   pixel32;
            struct gxIndexedColor           indexed;
            gxColorValue                    component[4];
    } element;
};

The color structure specifies three characteristics of a color:

Transfer Mode

The transfer mode in an ink object is contained in a gxTransferMode structure:

struct gxTransferMode{
    gxColorSpace                        space;          
    gxColorSet                          set;
    gxColorProfile                      profile;
    Fixed                               sourceMatrix[5][4];
    Fixed                               deviceMatrix[5][4];
    Fixed                               resultMatrix[5][4];
    gxTransferFlag                      flags;
    struct gxTransferComponent          component[4];
};

Like the color structure just described, the transfer mode structure specifies a color space. A transfer mode specifies its own color space because it can perform its operations according to its own definitions of color, independent of the color specifications in the rest of the ink object.

The transfer mode structure contains three 5 4 matrices (5 rows, 4 columns), the source matrix, device matrix, and result matrix, which it can use to transform colors for special effects, by blending proportions of the colors' components. In addition, it contains a set of transfer mode flags that control several aspects of the transfer mode operation.

The structure also contains up to four transfer components, used along with the matrices in the transfer mode operation. Transfer components contain the actual specification of the mode of transfer to use when drawing. Transfer components are defined by the gxTransferComponent structure:

struct gxTransferComponent{
        gxComponentMode         mode;
        gxComponentFlag         flags;
        gxColorValue            sourceMinimum;
        gxColorValue            sourceMaximum;
        gxColorValue            deviceMinimum;
        gxColorValue            deviceMaximum;
        gxColorValue            clampMinimum;
        gxColorValue            clampMaximum;
        gxColorValue            operand;
};

A transfer component contains a component mode specifying the type of transfer mode (like "copy" or "XOR") to use, an operand to apply (if the type calls for an operand), a set of maximum and minimum color values, and a set of flags. There is one transfer component for each color component (dimension) in the transfer mode's color space. Each of the transfer components in the transfer mode structure may specify a different component mode, which means that each dimension of a color space can be drawn with a different transfer mode when a shape is drawn.

How these parts of the transfer mode structure and transfer component structure define the transfer mode for drawing, and how you can use transfer modes to obtain the proper effect when drawing, are described in the section "Transfer Modes" .


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |